package com.xhsj.user.lsm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhsj.user.lsm.entity.TbContractApply;
import com.xhsj.user.lsm.model.MyContractApply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * <p>
 * 合同申请表 Mapper 接口
 * </p>
 *
 * @author suxiaolin
 * @since 2020-05-11
 */
@Mapper
public interface TbContractApplyMapper extends BaseMapper<TbContractApply> {
    //合同流程-审批记录
    IPage<Map> auditRecordList(IPage<Map> page, @Param("dataId") String dataId);
    //获取当前合同申请的数据
    Map<String,Object> getContractApplyList(@Param("dataId") String dataId);

    // 修改采购订单
//    int updatePurchaseOrder(@Param("id") String id);

    int updateOrderSubTask(@Param("id") String id, @Param("paymentWay") Integer paymentWay, @Param("advanceProportion") Integer advanceProportion,
                           @Param("secondProportion") Integer secondProportion, @Param("finalProportion") Integer finalProportion);


    void updateOrderSubTaskName(@Param("nodeName") String nodeName, @Param("subtaskId") String subtaskId);

    IPage<Object> findContractApplyList(IPage<TbContractApply> page, @Param("userId") String userId);

    IPage<MyContractApply> myContractApply(Page<MyContractApply> page, @Param("createBy") String createBy,
                                           @Param("contractNo") String contractNo, @Param("partiesName") String partiesName);

    String getFullNameByDataId(@Param("dataId") String dataId);
}
